<!DOCTYPE html>
<html class="x-admin-sm" lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>修改兼职工作详情信息</title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <link rel="stylesheet" th:href="@{/layui/css/font.css}">
    <link rel="stylesheet" th:href="@{/layui/css/xadmin.css}">
    <link rel="stylesheet" th:href="@{/layui/css/login.css}">
    <script charset="utf-8" th:src="@{/layui/lib/layui/layui.js}" type="text/javascript"></script>
    <script th:src="@{/layui/js/xadmin.js}" type="text/javascript"></script>
</head>
<body class="login-bg">
<div class="layui-fluid">
    <div class="layui-row" style="width: 740px;margin: 70px auto auto;">
        <form class="layui-form" enctype="multipart/form-data" id="fm" style="padding: 30px 20px;background: white;border-radius: 20px">
            <label style="display: none">
                <input name="id" th:value="${workDetail.id}" type="text">
            </label>
            <div style="float: left;">

                <div class="layui-form-item">
                    <label class="layui-form-label" for="requestMessage">岗位要求&emsp;</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" id="requestMessage" name="requestMessage" style="width: 500px" th:value="${workDetail.requestMessage}" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label" for="duty">岗位职责&emsp;</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" id="duty" name="duty" style="width: 500px" th:value="${workDetail.duty}" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label" for="salary">薪资待遇&emsp;</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" id="salary" name="salary" style="width: 500px" th:value="${workDetail.salary}" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label" for="joinMessage">加入须知&emsp;</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" id="joinMessage" name="joinMessage" style="width: 500px" th:value="${workDetail.joinMessage}" type="text">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label" for="contact">联系方式&emsp;</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" id="contact" name="contact" style="width: 500px" th:value="${workDetail.contact}" type="text">
                    </div>
                </div>

            </div>

            <button class="layui-btn" id="L_repass" lay-filter="edit" lay-submit
                    style="width: 100%" type="submit">修改信息</button>
        </form>
    </div>
</div>

<script>
    layui.use([ 'form', 'layer', 'laydate', 'jquery', 'upload' ], function() {
        const form = layui.form, layer = layui.layer,
            $ = layui.jquery;
        //监听提交
        form.on('submit(edit)', function(data) {
            $.ajax({
                url : "/admin_company_work_detail_message_save_or_edit",
                method : 'post',
                data : data.field,
                dataType : 'JSON',
                success : function(res) {
                    if (res.code === 0) {
                        //弹出提示，并在1秒后进行跳转
                        layer.alert("修改成功", {
                            icon : 6
                        }, function() {
                            //关闭当前frame
                            xadmin.close();

                            // 可以对父窗口进行刷新
                            xadmin.father_reload();
                            return false;
                        });
                    } else {
                        layer.msg("修改失败:" + res.msg);
                        return false;
                    }
                }
            });
            return false;
        });
    })
</script>
</body>
</html>